{% extends "../main.html" %}

{% block title %}{{ _("Configuration") }}{% end %}

{% block header %}
<script src="/static/js/pages/admin/configuration.js"></script>
<link href="/static/css/pages/admin/configuration.css" rel="stylesheet" />
{% end %}

{% block content %}
<div class="container">
    <form class="form-horizontal" action="/admin/configuration" method="post">
        <div class="control-group" style="float: right; padding-top: 20px;">
                <div class="controls">
                    <button class="btn btn-primary" type="submit">
                        {{ _("Update Configuration") }}
                    </button>
                </div>
        </div>
        <h1>
            <i class="fa fa-gear"></i>
            {{ _("Configuration") }}
        </h1>
        <div style="font-style: italic;"><strong>{{ _("Note") }}:</strong> {{ _("Not all options are accessible in the web configuration.  For more, see") }} <a href="https://github.com/moloch--/RootTheBox/wiki/Configuration-File-Details" target="_blank">rootthebox.cfg</a>.</div>
        <br />
        {% if errors is not None and len(errors) != 0 %}
            {% for error in errors %}
            <div class="alert alert-error">
                <a class="close" data-dismiss="alert" href="#">&times;</a>
                <h4 class="alert-heading">{{ _("ERROR") }}</h4>
                {{ error }}
            </div>
            {% end %}
        {% end %}
        <div class="well">
            {% raw xsrf_form_html() %}
            <div class="control-group">
                <label class="control-label" for="game-name">{{ _("Game Name") }}</label>
                <div class="controls">
                    <input required id="game-name" type="text" name="game_name" value="{{ config.game_name }}"
                        rel="popover"
                        data-original-title="{{ _('Game Name') }}"
                        data-content="{{ _('This is the name that will appear in the upper left corner') }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="min-user-password-length">{{ _("Minimum User Password Length") }}</label>
                <div class="controls">
                    <input required id="min-user-password-length" type="number" name="min_user_password_length" value="{{ config.min_user_password_length }}"
                        rel="popover" pattern="\d*"
                        data-original-title="{{ _('Min user password length') }}"
                        data-content="{{ _('Restrict players user password to this length') }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="restrict-registration">
                    <i class="fa fa-envelope"></i>
                    {{ _("Registration Email") }}
                </label>
                <div class="controls">
                    <input id="require-email" name="require_email" type="hidden" value="{{ str(config.require_email).lower() }}" />
                    <div id="require-email-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Require Email') }}"
                        data-content="{{ _('Enabling this feature will require players to provide an email address in order to create a new account.') }}">
                        <button id="require-email-enable" type="button" class="btn btn-success">
                            <i id="require-email-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="require-email-disable" type="button" class="btn btn-danger">
                            <i id="require-email-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="email-grouping" class="control-section">
                <div class="control-group">
                    <label class="control-label" for="validate-email">
                        <i class="fa fa-check-circle"></i>
                        {{ _("Validate Email") }}
                    </label>
                    <div class="controls">
                        <input id="validate-email" name="validate_email" type="hidden" value="{{ str(config.validate_email).lower() }}" />
                        <div id="validate-email-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{ _('Validate Email') }}"
                            data-html="true"
                            data-content="{{ _('Enabling this feature will require validation of email before the user can access the game.  If this option is disabled, email will not be verified.') }}<br><br><strong>{{ _('Note: Mail settings must be defined.') }}</strong>">
                            <button id="validate-email-enable" type="button" class="btn btn-success">
                                <i id="validate-email-enable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Enable") }}
                            </button>
                            <button id="validate-email-disable" type="button" class="btn btn-danger">
                                <i id="validate-email-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Disable") }}
                            </button>
                        </div>
                    </div>
                </div>             
            </div>
            <div class="control-group">
                <label class="control-label" for="restrict-registration">
                    <i class="fa fa-key"></i>
                    {{ _("Registration Tokens") }}
                </label>
                <div class="controls">
                    <input id="restrict-registration" name="restrict_registration" type="hidden" value="{{ str(config.restrict_registration).lower() }}" />
                    <div id="restrict-registration-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Registration Tokens') }}"
                        data-content="{{ _('Enabling this feature will require players to provide a valid registration token in order to create a new account.  Registration tokens are created in the admin interface.') }}">
                        <button id="restrict-registration-enable" type="button" class="btn btn-success">
                            <i id="restrict-registration-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="restrict-registration-disable" type="button" class="btn btn-danger">
                            <i id="restrict-registration-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div class="control-group">
                    <label class="control-label" for="global-notifications">
                        <i class="fa fa-list-alt"></i>
                        {{ _("Global Notifications") }}
                    </label>
                    <div class="controls">
                        <input id="global-notifications" name="global_notification" type="hidden" value="{{ str(config.global_notification).lower() }}" />
                        <div id="global-notifications-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{ _('Global Notifications') }}"
                            data-content="{{ _('Enabling this feature will send flag and level unlock notifications to all players in the game.  Disabling this option will limit those notifications to team members.') }}">
                            <button id="global-notifications-enable" type="button" class="btn btn-success">
                                <i id="global-notifications-enable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Enable") }}
                            </button>
                            <button id="global-notifications-disable" type="button" class="btn btn-danger">
                                <i id="global-notifications-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Disable") }}
                            </button>
                        </div>
                    </div>
                </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="rank_by">
                    <i class="fa fa-arrow-circle-up"></i>
                    {{ _("Scoreboard Rank By") }}</label>
                <div class="controls">
                    <select id="rank_by" name="rank_by" 
                        rel="popover"
                        data-original-title="{{ _('Rank By') }}"
                        data-content="{{ _('This selection determines the method by which the scoreboard is primarily ranked.') }}">
                        <option id="moneyname" value="money" {% if config.rank_by == "money" %}selected{% end %}>
                            {% if config.banking %}{{ _("Money") }}{% else %}{{ _("Points") }}{% end %}
                        </option>
                        <option value="flags" {% if config.rank_by == "flags" %}selected{% end %}>{{ _("Flags") }}</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="scoreboard_visibility">
                    <i class="fa fa-eye"></i>
                    {{ _("Scoreboard Visibility") }}</label>
                <div class="controls">
                    <select id="scoreboard_visibility" name="scoreboard_visibility" 
                        rel="popover"
                        data-original-title="{{ _('Scoreboard Visibility') }}"
                        data-html="true"
                        data-content="{{ _('This selection determines the visibility of the scoreboard menu and pages.') }}<br/><br/>{{ _('It can be visible to all visitors (public), to authenticated users (players), or only to administrators (admins).') }}">
                        <option value="public" {% if config.scoreboard_visibility == "public" %}selected{% end %}>{{ _("Public") }}</option>
                        <option value="players" {% if config.scoreboard_visibility == "players" %}selected{% end %}>{{ _("Players") }}</option>
                        <option value="admins" {% if config.scoreboard_visibility == "admins" %}selected{% end %}>{{ _("Admins") }}</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="hints-taken">
                    <i class="fa fa-medkit"></i>
                    {{ _("Display Hints Taken") }}
                </label>
                <div class="controls">
                    <input id="hints-taken" name="hints_taken" type="hidden" value="{{ str(config.hints_taken).lower() }}" />
                    <div id="hints-taken-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Display Hints Taken') }}"
                        data-content="{{ _('Enabling this feature will display the number of hints taken on the scoreboard by a team or player.  Useful when hints are free.  A lower hint count is used for sorting when scores or flags are equal.  Disabling this option will remove the hint count from the scoreboard.') }}">
                        <button id="hints-taken-enable" type="button" class="btn btn-success">
                            <i id="hints-taken-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="hints-taken-disable" type="button" class="btn btn-danger">
                            <i id="hints-taken-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="teams">
                    <i class="fa fa-group"></i>
                    {{ _("Team Play") }}
                </label>
                <div class="controls">
                    <input id="teams" name="teams" type="hidden" value="{{ str(config.teams).lower() }}" />
                    <div id="teams-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Team Play') }}"
                        data-content="{{ _('Enabling this feature will set the game and scoreboard up for team competitive play.  If this option is disabled, the game is set up for individual competitive play.') }}">
                        <button id="teams-enable" type="button" class="btn btn-success">
                            <i id="teams-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="teams-disable" type="button" class="btn btn-danger">
                            <i id="teams-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="team-grouping" class="control-section">
                <div class="control-group">
                    <label class="control-label" for="public-teams">
                        {{ _("Public Team Creation") }}
                    </label>
                    <div class="controls">
                        <input id="public-teams" name="public_teams" type="hidden" value="{{ str(config.public_teams).lower() }}" />
                        <div id="public-teams-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{ _('Public Teams') }}"
                            data-content="{{ _('Enabling this feature will allow players to create their own teams during registration.  If this option is disabled, the admin must create teams for players to join.') }}">
                            <button id="public-teams-enable" type="button" class="btn btn-success">
                                <i id="public-teams-enable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Enable") }}
                            </button>
                            <button id="public-teams-disable" type="button" class="btn btn-danger">
                                <i id="public-teams-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Disable") }}
                            </button>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="show-mvp">
                        {{ _("MVP Scoreboard") }}
                    </label>
                    <div class="controls">
                        <input id="show-mvp" name="show_mvp" type="hidden" value="{{ str(config.show_mvp).lower() }}" />
                        <div id="show-mvp-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{ _('Show MVP') }}"
                            data-content="{{ _('Enabling this feature will display the player MVP scoreboard.  Any player that has contributed points to the team will be displayed.  If this option is disabled, the MVP Scoreboard will be hidden.')}}">
                            <button id="show-mvp-enable" type="button" class="btn btn-success">
                                <i id="show-mvp-enable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Enable") }}
                            </button>
                            <button id="show-mvp-disable" type="button" class="btn btn-danger">
                                <i id="show-mvp-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Disable") }}
                            </button>
                        </div>
                    </div>
                </div>
                <div id="mvp-grouping" class="control-section">
                    <div class="control-group">
                        <label class="control-label" for="mvp_max">{{ _("MVP List Top") }}</label>
                        <div class="controls">
                            <input required id="mvp-max" max="100" type="number" name="mvp_max" value="{{ config.mvp_max }}"
                                rel="popover" pattern="\d*"
                                data-original-title="{{ _('MVP - List Top N Payers') }}"
                                data-content="{{ _('This is the maximum number of players displayed on the MVP list (default 10) with a score > 0.') }}" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="team-sharing">
                        {{ _("Team Sharing") }}
                    </label>
                    <div class="controls">
                        <input id="team-sharing" name="team_sharing" type="hidden" value="{{ str(config.team_sharing).lower() }}" />
                        <div id="team-sharing-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{ _('Team Sharing') }}"
                            data-content="{{ _('Enabling this feature will allow players to share code (pastebin) and files in-game.  Disabling this feature will remove these options from the Tools Menu.') }}">
                            <button id="team-sharing-enable" type="button" class="btn btn-success">
                                <i id="team-sharing-enable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Enable") }}
                            </button>
                            <button id="team-sharing-disable" type="button" class="btn btn-danger">
                                <i id="team-sharing-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Disable") }}
                            </button>
                        </div>
                    </div>
                </div>
                <div id="teamshare-grouping" class="control-section">
                    <div class="control-group">
                        <label class="control-label" for="max_pastebin_size">{{ _("Pastebin Character Limit") }}</label>
                        <div class="controls">
                            <input required id="max-pastebin-size" max="4096" type="number" name="max_pastebin_size" value="{{ config.max_pastebin_size }}"
                                rel="popover" pattern="\d*"
                                data-original-title="{{ _('Max PasteBin Size') }}"
                                data-content="{{ _('This is the the limit of characters allowed for a pastebin post.') }}" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="max-team-size">{{ _("Max Team Size") }}</label>
                    <div class="controls">
                        <input required id="max-team-size" type="number" name="max_team_size" value="{{ config.max_team_size }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Max Team Size') }}"
                            data-content="{{ _('Limit number of players that can be on any one team') }}" />
                    </div>
                </div>               
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="story_mode">
                    <i class="fa fa-video-camera"></i>
                    {{ _("Story Mode") }}
                </label>
                <div class="controls">
                    <input id="story_mode" name="story_mode" type="hidden" value="{{ str(config.story_mode).lower() }}" />
                    <div id="story-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Story Mode') }}"
                        data-html="true"
                        data-content="{{ _('Enabling this feature will allow the game to display flag or box capture messages that may be added. By default, the game follows the story line of Morris, an employer that assigns missions.') }}<br/><br/>{{ _('Disabling this option will skip the storyline and give the player an instant capture message.')}}">
                        <button id="story-enable" type="button" class="btn btn-success">
                            <i id="story-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="story-disable" type="button" class="btn btn-danger">
                            <i id="story-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="dynamic_flag_value">
                    <i class="fa fa-bar-chart-o"></i>
                    {{ _("Dynamic Scoring") }}
                </label>
                <div class="controls">
                    <input id="dynamic_flag_value" name="dynamic_flag_value" type="hidden" value="{{ str(config.dynamic_flag_value).lower() }}" />
                    <div id="dynamic_flag-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Dynamic Scoring') }}"
                        data-content="{{ _('Enabling this feature will decrease the reward for a flag based on the number of captures.  If this option is disabled, the flag value remains consistent as other players capture it.')}}">
                        <button id="dynamic_flag-enable" type="button" class="btn btn-success">
                            <i id="dynamic_flag-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="dynamic_flag-disable" type="button" class="btn btn-danger">
                            <i id="dynamic_flag-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="dynamic_flag-grouping">
                <div class="control-group control-section">
                    <label class="control-label" for="dynamic_flag_type">{{ _("Dynamic Decay Type") }}</label>
                    <div class="controls">
                        <select id="dynamic_flag_type" name="dynamic_flag_type" 
                            rel="popover"
                            data-original-title="{{ _('Dynamic Decay Type') }}"
                            data-html="true"
                            data-content="{{ _('This selection determines the method by which dynamic scoring is applied.') }}<br><br>
                                <strong>{{_('Decrease Future Captures')}}</strong><br>{{ _('Decreases the flag value for future captures - this method rewards speed of capture.') }}<br><br>
                                <strong>{{ _('Decrease All Captures') }}</strong><br>{{ _('Decreases the flag value for past and future team captures - this method rewards difficulty.') }}">
                            <option value="decay_future" {% if config.dynamic_flag_type == "decay_future" %}selected{% end %}>
                                {{_("Decrease Future Captures")}}
                            </option>
                            <option value="decay_all" {% if config.dynamic_flag_type == "decay_all" %}selected{% end %}>
                                {{ _("Decrease All Captures") }}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="control-group control-section">
                    <label class="control-label" for="flag_value_decrease">{{ _("Flag Decrease Value") }}</label>
                    <div class="controls">
                        <input required id="flag_value_decrease" type="number" min="0" max="100" name="flag_value_decrease" value="{{ config.flag_value_decrease }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Flag Decrease Value') }}"
                            data-content="{{ _('Decrease flag reward by this percent per capture.') }}" />
                    </div>
                </div>
                <div class="control-group control-section">
                    <label class="control-label" for="flag_value_minimum">{{ _("Flag Minimum Value") }}</label>
                    <div class="controls">
                        <input required id="flag_value_minimum" type="number" name="flag_value_minimum" value="{{ config.flag_value_minimum }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Flag Minimum Value') }}"
                            data-content="{{ _('Decrease flag until it reaches this minimum value.') }}" />
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="max-flag-attempts">
                        <i class="fa fa-ban"></i>
                        {{ _("Max Flag Attempts") }}
                    </label>
                <div class="controls">
                    <input required id="max-flag-attempts" type="number" min="1" type="number" name="max_flag_attempts" value="{{ config.max_flag_attempts }}"
                        rel="popover" pattern="\d*"
                        data-original-title="{{ _('Maximum Flag Attempts') }}"
                        data-html="true"
                        data-content="{{ _('Limits the number of attempts to capture a flag.  Once the limit is reached, no further action can be taken on that flag.') }}<br/><br/>{{ _('NOTE: This setting is ignored if the box flag submission type is set to Single Box.')}}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="penalize_flag_value">
                    <i class="fa fa-minus-circle"></i>
                    {{ _("Incorrect Penalty") }}
                </label>
                <div class="controls">
                    <input id="penalize_flag_value" name="penalize_flag_value" type="hidden" value="{{ str(config.penalize_flag_value).lower() }}" />
                    <div id="penalty-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Incorrect Penalty') }}"
                        data-html="true"
                        data-content="{{ _('Enabling this feature will apply a penalty for incorrect capture attempts.  The penalty is an instant deduction from the score, not a decrease in the flag value.') }}<br/><br/>{{ _('If this option is disabled, there is no cost for submitting incorrect flags.') }}<br/><br/>{{ _('NOTE: This setting is ignored if the box flag submission type is set to Single Box.')}}">
                        <button id="penalty-enable" type="button" class="btn btn-success">
                            <i id="penalty-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="penalty-disable" type="button" class="btn btn-danger">
                            <i id="penalty-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="penalty-grouping">
                <div class="control-group control-section">
                    <label class="control-label" for="flag_start_penalty">{{ _("Flag Penalty Start") }}</label>
                    <div class="controls">
                        <input class="penaltyval" required id="flag_start_penalty" type="number" min="1" name="flag_start_penalty" value="{{ config.flag_start_penalty }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Flag Penalty Start') }}"
                            data-html="true"
                            data-content="{{ _('When to start applying the penalty.  For example, you may want the first incorrect attempt to be free, but penalize subsequent attempts.') }}<br/><br/>1 = {{ _('deduct on & after') }} 1st {{ _('attempt') }}<br/>2 = {{ _('deduct on & after') }} 2nd {{ _('attempt') }}<br/>{{ _('and so on') }} ...<br/><br/>{{ _('Maximum Penalty is determined as')}}<br/>{{ _('(stop - start) * cost.')}}" />
                    </div>
                </div>
                <div class="control-group control-section">
                        <label class="control-label" for="flag_stop_penalty">{{ _("Flag Penalty Stop") }}</label>
                        <div class="controls">
                            <input class="penaltyval" required id="flag_stop_penalty" type="number" min="1" name="flag_stop_penalty" value="{{ config.flag_stop_penalty }}"
                                rel="popover" pattern="\d*"
                                data-original-title="{{ _('Flag Penalty Stop') }}"
                                data-html="true"
                                data-content="{{ _('When to stop applying the penalty.  For example, you may want to only penalize a certain total of the flags value and allow any further attempts to be free, thus allowing all flags to have some value.') }}<br/><br/>4 = {{ _('stop on & after') }} 4th {{ _('attempt') }}<br/>5 = {{ _('stop on & after') }} 5th {{ _('attempt') }}<br/>{{ _('and so on') }} ...<br/><br/{{ _('Maximum Penalty is determined as')}}<br/>{{ _('(stop - start) * cost.')}}" />
                    </div>
                </div>
                <div class="control-group control-section">
                    <label class="control-label" for="flag_penalty_cost">{{ _("Flag Penalty Cost") }}</label>
                    <div class="controls">
                        <input class="penaltyval" required id="flag_penalty_cost" type="number" min="0" max="500" name="flag_penalty_cost" value="{{ config.flag_penalty_cost }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Flag Penalty % Cost') }}"
                            data-html="true"
                            data-content="{{ _('Penalize the score by this percent of the flag value for each incorrect attempt (applied after dynamic scoring if enabled).') }}<br/><br/>{{ _('Maximum Penalty is determined as') }}<br/>{{ _('(stop - start) * cost.') }}" />
                    </div>
                </div>
                <div class="control-group control-section">
                    <div class="controls" id="penalty_description" 
                        data-maxpenalty="{{ _('Maximum Penalty') }}" 
                        data-applytext="{{ _('Apply penalty on attempt') }}"
                        data-flagvalue="{{ _('of Flag Value') }}"></div>
                    <div class="controls" id="current_max_penalty" style="font-weight: bold;"></div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="banking">
                    <i class="fa fa-dollar"></i>
                    {{ _("Banking System") }}
                </label>
                <div class="controls">
                    <input id="banking" name="banking" type="hidden" value="{{ str(config.banking).lower() }}" />
                    <div id="banking-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Banking System') }}"
                        data-content="{{ _('Enabling this feature will set the game to use a money based scoring system.  If this option is disabled, the game uses a points based scoring system.') }}">
                        <button id="banking-enable" type="button" class="btn btn-success">
                            <i id="banking-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="banking-disable" type="button" class="btn btn-danger">
                            <i id="banking-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="bank-grouping">
                <div class="control-group control-section">
                    <label class="control-label" for="max-password-length">{{ _("Bank Password Length") }}</label>
                    <div class="controls">
                        <input required id="max-password-length" type="number" name="max_password_length" value="{{ config.max_password_length }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Bank Password Length') }}"
                            data-content="{{ _('Restrict players bank password to this length') }}" />
                    </div>
                </div>
                <div class="control-group control-section">
                    <label class="control-label" for="starting-team-money">{% if config.teams %}{{ _("Team") }}{% else %}{{ _("Player") }}{% end %} {{ _("Starting Money") }}</label>
                    <div class="controls">
                        <input required id="starting-team-money" type="number" name="starting_team_money" value="{{ config.starting_team_money }}"
                            rel="popover" pattern="\d*" min="0"
                            data-original-title="{% if config.teams %}{{ _('Team') }}{% else %}{{ _('Player') }}{% end %} {{ _('Starting Money') }}"
                            data-content="{{ _('The starting money for a new') }} {% if config.teams %}{{ _('team') }}{% else %}{{ _('player')}}{% end %} {{ _('when using banking.') }}  {{ _('When banking is disabled') }}, {% if config.teams %}{{ _('teams') }}{% else %}{{ _('players') }}{% end %} {{_('start with 0 points')}}." />
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="market">
                    <i class="fa fa-shopping-cart"></i>
                    {{ _("Black Market") }}
                </label>
                <div class="controls">
                    <input id="use-black-market" name="use_black_market" type="hidden" value="{{ str(config.use_black_market).lower() }}" />
                    <div id="use-black-market-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Black Market') }}"
                        data-content="{{ _('Enabling this feature will allow teams to purchase upgrades, such as the Federal Reserve, Source Code Market, or SWAT.') }}">
                        <button id="use-black-market-enable" type="button" class="btn btn-success">
                            <i id="use-black-market-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="use-black-market-disable" type="button" class="btn btn-danger">
                            <i id="use-black-market-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="blackmarket-grouping" class="control-section">
                <div class="control-group">
                    <label class="control-label" for="password-upgrade-cost">{{ _("Password Upgrade Cost") }}</label>
                    <div class="controls">
                        <input required id="password-upgrade-cost" type="number" name="password_upgrade_cost" value="{{ config.password_upgrade_cost }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Password Upgrade Cost') }}"
                            data-content="{{ _('This is the amount a player must pay to upgrade their bank passwords hashing algorithm; each subsequent purchase is also increased by this amount.') }}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="bribe-cost">{{ _("Bribe Price") }}</label>
                    <div class="controls">
                        <input required id="bribe-cost" type="number" name="bribe_cost" value="{{ config.bribe_cost }}"
                            rel="popover" pattern="\d*"
                            data-original-title="{{ _('Bribe Amount') }}"
                            data-content="{{ _('This is the amount a player must pay to S.W.A.T. another players account.  Subsequent SWATs of the same player are also increased by this amount each time.') }}" />
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label" for="bots">
                    <i class="fa fa-android"></i>
                    {{ _("Botnets") }}
                </label>
                <div class="controls">
                    <input id="use-bots" name="use_bots" type="hidden" value="{{ str(config.use_bots).lower() }}" />
                    <div id="use-bots-button" class="btn-group" data-toggle="buttons-radio"
                        rel="popover"
                        data-original-title="{{ _('Botnets') }}"
                        data-content="{{ _('Enabling this setting activates the botnet features.  Teams can run their bot executables on boxes they pwn and are paid for each bot over time.') }}">
                        <button id="use-bots-enable" type="button" class="btn btn-success">
                            <i id="use-bots-enable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Enable") }}
                        </button>
                        <button id="use-bots-disable" type="button" class="btn btn-danger">
                            <i id="use-bots-disable-icon" class="fa fa-fw fa-square-o"></i>
                            {{ _("Disable") }}
                        </button>
                    </div>
                </div>
            </div>
            <div id="bot-grouping" class="control-group control-section">
                <label class="control-label" for="bot_reward">{{ _("Bot Reward") }}</label>
                <div class="controls">
                    <input required id="bot-reward" type="text" name="bot_reward" value="{{ config.bot_reward }}"
                        rel="popover" pattern="\d*"
                        data-original-title="{{ _('Bot Reward') }}"
                        data-content="{{ _('This is the amount of money a team is paid per-bot on every interval.  The interval must be set in the .cfg file manually; the default is 5 minutes.') }}" />
                </div>
            </div>
            <hr />
        </div>
    </form>
</div>
{% end %}
